package com.slaffka.action;

import com.slaffka.dao.FilialDAO;
import com.slaffka.model.Filial;

import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: slaffka
 * Date: 02.12.12
 * Time: 13:34
 * To change this template use File | Settings | File Templates.
 */
@ViewScoped
@Named("filialAction")
public class FilialAction extends AbstractAction implements Serializable {

    @Inject
    FilialDAO filialDAO;

    public List<Filial> getFilialList(){
        return filialDAO.getFilialList();
    }

    public void recalculateMultiFilialAmount(){
        filialDAO.recalculateMultiFilialAmount();
    }

    public void updateFilial(Filial filial){
        filialDAO.updateFilial(filial);
//        filialDAO.updateCapitalFilial(filial.getFilialId(), filial.getCapital());
//        filialDAO.recalculateMultiFilialAmount();
    }
}
